package com.fate.system.vo.menu;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Size;
import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * @Author: ten.x @TableName sys_menu @Date: 2024-08-09 01:48:28 @Version: V1.0
 */
@Data
@Accessors(chain = true)
@TableName(value = "sys_menu")
@EqualsAndHashCode(callSuper = false)
public class MenuDetailVO implements Serializable {

  @Serial
  @TableField(exist = false)
  private static final long serialVersionUID = 1L;

  /** 主键：id */
  @TableId(value = "id")
  @Schema(description = "id")
  @Length(max = 64, message = "编码长度不能超过64")
  private String id;

  /** 父id */
  @Size(max = 64, message = "编码长度不能超过64")
  @TableField(value = "pid")
  @Schema(description = "父id")
  @Length(max = 64, message = "编码长度不能超过64")
  private String pid;

  /** 菜单名称 */
  @Size(max = 255, message = "编码长度不能超过255")
  @TableField(value = "title")
  @Schema(description = "菜单名称")
  @Length(max = 255, message = "编码长度不能超过255")
  private String title;

  /** 路由地址 */
  @Size(max = 255, message = "编码长度不能超过255")
  @TableField(value = "path")
  @Schema(description = "路由地址")
  @Length(max = 255, message = "编码长度不能超过255")
  private String path;

  /** 菜单类型 字典 menu_type： 1目录 2菜单 3按钮 */
  @Size(max = 20, message = "编码长度不能超过20")
  @TableField(value = "menu_type")
  @Schema(description = "菜单类型 字典 menu_type： 1目录 2菜单 3按钮")
  @Length(max = 20, message = "编码长度不能超过20")
  private String menuType;

  /** 排序 */
  @TableField(value = "order_number")
  @Schema(description = "排序")
  private Integer orderNumber;

  /** 权限标识 */
  @Size(max = 255, message = "编码长度不能超过255")
  @TableField(value = "authority")
  @Schema(description = "权限标识")
  @Length(max = 255, message = "编码长度不能超过255")
  private String authority;

  /** 菜单图标 */
  @Size(max = 255, message = "编码长度不能超过255")
  @TableField(value = "icon")
  @Schema(description = "菜单图标")
  @Length(max = 255, message = "编码长度不能超过255")
  private String icon;

  /** 是否隐藏 */
  @TableField(value = "hide")
  @Schema(description = "是否隐藏")
  private Boolean hide;

  /** 其他路由元信息 */
  @Size(max = 255, message = "编码长度不能超过255")
  @TableField(value = "meta")
  @Schema(description = "其他路由元信息")
  @Length(max = 255, message = "编码长度不能超过255")
  private String meta;

  /** 打开方式 字典 open_type： 1组件 2内链 3链接 */
  @Size(max = 20, message = "编码长度不能超过20")
  @TableField(value = "open_type")
  @Schema(description = "打开方式 字典 open_type： 1组件 2内链 3链接")
  @Length(max = 20, message = "编码长度不能超过20")
  private String openType;

  /** 逻辑删除 */
  @TableField(value = "deleted")
  @Schema(description = "逻辑删除")
  private Integer deleted;

  /** 租户id */
  @Size(max = 64, message = "编码长度不能超过64")
  @TableField(value = "tenant_id")
  @Schema(description = "租户id")
  @Length(max = 64, message = "编码长度不能超过64")
  private String tenantId;

  /** 创建时间 */
  @TableField(value = "gmt_create")
  @Schema(description = "创建时间")
  @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  private LocalDateTime gmtCreate;

  /** 修改时间 */
  @TableField(value = "gmt_modified")
  @Schema(description = "修改时间")
  @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  private LocalDateTime gmtModified;
}
